package com.woniu.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class WebLog {
    private Integer logId;
    // 登录IP
    private String ip;
    private String address;
    // 操作系统
    private String operatingSystem;
    // 浏览器
    private String browser;
    // 操作动作（登录成功/注册成功/登录失败等，需结合业务）
    private String action;
    // 访问时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;

    public WebLog() {
    }
    public WebLog(String ip, String address, String operatingSystem, String browser, String action, Date time) {

        this.ip = ip;
        this.address = address;
        this.operatingSystem = operatingSystem;
        this.browser = browser;
        this.action = action;
        this.time = time;
    }
    public WebLog(Integer logId, String ip, String address, String operatingSystem, String browser, String action, Date time) {
        this.logId = logId;
        this.ip = ip;
        this.address = address;
        this.operatingSystem = operatingSystem;
        this.browser = browser;
        this.action = action;
        this.time = time;
    }

    @Override
    public String toString() {
        return "WebLog{" +
                "log_id=" + logId +
                ", ip='" + ip + '\'' +
                ", Address='" + address + '\'' +
                ", operatingSystem='" + operatingSystem + '\'' +
                ", browser='" + browser + '\'' +
                ", action='" + action + '\'' +
                ", time=" + time +
                '}';
    }

    public Integer getlogId() {
        return logId;
    }

    public void setlogId(Integer logId) {
        this.logId = logId;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getOperatingSystem() {
        return operatingSystem;
    }

    public void setOperatingSystem(String operatingSystem) {
        this.operatingSystem = operatingSystem;
    }

    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }
}
